{% extends "devhub/base.html" %}


{% set title = _('Manage My Submissions') %}

{% block title %}{{ dev_page_title(title) }}{% endblock %}

{% block content %}
  <section>
    <header class="hero">
      <h1>{{ title }}</h1>

      {% if addon_tab %}
        {% set cnt = addons.paginator.count %}
        {# L10n: {0} is an integer. #}
        <h2 class="submission-count">{{ ngettext('<b>{0}</b> add-on', '<b>{0}</b> add-ons', cnt)|format_html(cnt|numberfmt) }}</h2>
      {% endif %}
    </header>
  </section>

<section class="secondary devhub-sidebar">
  <p id="submit-addon" class="submit-cta">
    <a href="{{ url('devhub.submit.agreement') }}"
       class="button prominent">{{ _('Submit a New Add-on') }}</a>
  </p>
  <p class="submit-theme submit-cta">
    <a href="{{ url('devhub.submit.theme.agreement') }}"
       class="button prominent">{{ _('Submit a New Theme') }}</a>
  </p>
  <div class="item recent-activity">
    <h3>
      {{ _('Recent Activity') }}
      <a href="{{ rss }}" class="subscribe-feed" title="{{ _('Subscribe to this feed') }}">
        {{ _('Subscribe to this feed') }}</a>
    </h3>
    {% if addon_items %}
      <ul>
        {% for item in addon_items %}
          <li class="item">
            {{ item }}
            <span class="activity-timestamp">
            {% trans user=item.user.name, ago=item.created|timesince %}
            {{ ago }} by {{ user }}
            {% endtrans %}
            </span>
          </li>
        {% endfor %}
      </ul>
    {% endif %}
    <p class="older-activity"><a href="{{ url('devhub.feed_all') }}">
      {{ _('Older activity for My Add-ons') }} &#9658;</a></p>
  </div>

  {% include "devhub/includes/blog_posts.html" %}
</section>

{% if addon_tab %}
  {% include "addons/includes/dashboard_tabs.html" %}
  <section class="dashboard primary" role="main">
    <div class="listing island hero c">
      {{ addon_listing_header(request.get_full_path(), search_filter=filter) }}
      <div class="items">
        {{ dev_addon_listing_items(addons.object_list) }}
      </div>
      {% if addons.paginator.num_pages > 1 %}
        {{ addons|paginator }}
      {% endif %}
    </div>
  </section>
{% endif %}

{% if theme %}
  {# L10n: {0} is an integer. #}
  <section class="dashboard primary theme-dashboard">
    {% set cnt = themes.paginator.count %}
    <h2 class="submission-count">
      {{ ngettext('<b>{0}</b> theme', '<b>{0}</b> themes', cnt)|format_html(cnt|numberfmt) }}
    </h2>
    {% include "addons/includes/dashboard_tabs.html" %}
    <div class="listing island hero c">
      {{ addon_listing_header(request.get_full_path(), search_filter=filter) }}
      <div class="items">
        {{ dev_addon_listing_items(themes.object_list) }}
      </div>
      {% if themes.paginator.num_pages > 1 %}
        {{ themes|paginator }}
      {% endif %}
    </div>
  </section>
{% endif %}
{% endblock %}
